<style scoped>
    .navx {
      width: 100%;
      height: 0.88rem;
      display: flex;
      position: fixed;
      z-index: 999;
      left: 0;
      top: 0;
      font-size: 16px;
      background: #F8FAFA;
    }
  .bg{
    background-image: linear-gradient(-90deg, #3CBCFF 0%, #2094FA 100%);
  }
  .back{
    width: 0.4rem;
    height: 0.4rem;
  }
  .back img{
    width: 100%;
    display: block;
    margin-left: 0.26rem;
  }
  .navx-box{
    position: relative;
    display: flex;
    flex-direction: row;
    justify-items: center;
    align-items: center;
    width: 100%;
    background: white;
  }
  .nav-title{
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
  }
  .cuoti{
    width: 0.40rem;
    height: 0.40rem;
    position: absolute;
    right: 1.2rem;
    margin-top: -0.02rem;
  }
  .ask{
      width: 0.44rem;
      height: 0.44rem;
      position: absolute;
      right: 0.28rem;
    }
  .cuoti img{
    display: block;
    width: 100%;
  }
  .ask img{
    display: block;
    width: 100%;
  }
</style>
<template>
    <div class="navx">
      <div class="navx-box" v-if="title=='专属试题'">
        <div class="back" @click="back">
          <img src="../assets/img/back.png" />
        </div>
        <div class="nav-title">{{title}}</div>
        <div class="cuoti">
          <img src="../assets/img/cuoti.png" />
        </div>
        <div class="ask" @click="goasklist">
          <img src="../assets/img/ask.png" />
        </div>
      </div>
      <div class="navx-box" v-else-if="title=='我的提问'">
        <div class="back" @click="back">
          <img src="../assets/img/back.png" />
        </div>
        <div class="nav-title">{{title}}</div>
      </div>
      <div class="navx-box" v-else-if="title=='历史试题'">
        <div class="back" @click="back">
          <img src="../assets/img/back.png" />
        </div>
        <div class="nav-title">{{title}}</div>
        <div class="ask" @click="goreportlist">
          <img src="../assets/img/baogao.jpg" />
        </div>
      </div>
      <div class="navx-box" v-else-if="title=='答题报告'">
        <div class="back" @click="back">
          <img src="../assets/img/back.png" />
        </div>
        <div class="nav-title">{{title}}</div>
      </div>
      <div class="navx-box" v-else>
        <div class="back" @click="back">
          <img src="../assets/img/back.png" />
        </div>
        <div class="nav-title">专属试题</div>
        <div class="ask" @click="datika">
          <img src="../assets/img/datika.png" />
        </div>
      </div>
    </div>
</template>

<script>
    import axios from 'axios'
    export default {
        name: '',
        data() {
            return {
              title:'',
              path:''
            }
        },props:['msg']
      , created() {

        },watch: {
        msg(newValue, oldValue) {
          this.title=newValue
        }
      },
      mounted() {
          var path=this.$route.path;
          // console.log(path,this.msg)
          if(path=='/'){
            this.title='专属试题';
            this.path='/';
          }else if(path=='/asklist'){
            this.title='我的提问';
            this.path='/asklist';
          }else if(path=='/asklist'){
            this.title='我的提问';
            this.path='/asklist';
          }else if(path=='/report'){
            this.title='答题报告';
          }


        }, methods: {
        datika(){

        },
        back(){
          this.$router.go(-1)
        },
        goasklist(){
          this.$router.push(`/asklist`);
        },
        goreportlist(){
          this.$router.push(`/report`);
        }
      }
    }
</script>
